func solveSudoku(board [][]byte)  {
    backTracking(board)
}

func backTracking(board [][]byte) bool {
    for i:=0; i<len(board); i++ {
        for j:=0; j<len(board[0]); j++ {
            if board[i][j] != '.' {
                continue
            }
            for n:='1'; n<='9'; n++ {
                if isValid(i, j, byte(n), board) {
                    board[i][j] = byte(n)
                    if backTracking(board) {
                        return true
                    }
                    board[i][j] = '.'
                }
            }
            return false
        }
    }
    return true
}

func isValid(i, j int, k byte, board [][]byte) bool {
    // 行校验
    for col:=0; col<len(board[0]); col++ {
        if board[i][col] == k {
            return false
        }
    }
    // 列校验
    for row:=0; row<len(board); row++ {
        if board[row][j] == k {
            return false
        }
    }
    // 9共格校验
    rowStartIndex := (i/3) * 3
    colStartIndex := (j/3) * 3

    for i:=rowStartIndex; i<rowStartIndex+3; i++ {
        for j:=colStartIndex; j<colStartIndex+3; j++ {
            if board[i][j] == k {
                return false
            }
        }
    }
    
    return true
}